package com.hanhai;


import java.time.LocalDate;
import java.time.Period;
import java.time.temporal.TemporalUnit;
import java.util.List;

/**
 * @Author weijingchen
 * @Date 2025/5/27 6:45
 * @Version 1.0.0
 */
public class PeriodTest {
    public static void main(String[] args) {
        LocalDate now = LocalDate.now();

        LocalDate date = LocalDate.of(2025, 2, 21);

        Period between = Period.between(date, now);
        System.out.println("两者时间间隔年：" + between.getYears());
        System.out.println("两者时间间隔月：" + between.getMonths());
        System.out.println("两者时间间隔日：" + between.getDays());


    }
}
